From: Eli Zaretskii Date: Wed, 5 Dec 2012 17:10:00 +0000 (+0200) Subject: Fix one part of bug #13079 with temporary files in call-process-region. X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1^2~5^2~2326^2~411 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=d3cefd1358e021cc4d510afb18916b067e6b1419;p=emacs.git Fix one part of bug #13079 with temporary files in call-process-region. src/callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp fails, signal an error instead of continuing with an empty string. --- diff --git a/src/ChangeLog b/src/ChangeLog index 6d2cd720672..e71667f7dcf 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2012-12-05 Eli Zaretskii + + * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp + fails, signal an error instead of continuing with an empty + string. (Bug#13079) + 2012-12-04 Eli Zaretskii * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]: diff --git a/src/callproc.c b/src/callproc.c index c236f22fc86..ce3b11af696 100644 --- a/src/callproc.c +++ b/src/callproc.c @@ -977,7 +977,15 @@ usage: (call-process-region START END PROGRAM &optional DELETE BUFFER DISPLAY &r close (fd); } #else + errno = 0; mktemp (tempfile); + if (!*tempfile) + { + if (!errno) + errno = EEXIST; + report_file_error ("Failed to open temporary file using pattern", + Fcons (pattern, Qnil)); + } #endif filename_string = build_string (tempfile);